﻿#region License statement
// NJamb, a specification and delta-specification DSL
// Copyright (c) 2010-2011, Mark Knell
// Published under the MIT License; all other rights reserved
#endregion

#region using...
using System.Collections.Generic;
using NJamb.Specifications;
using Stile.Patterns.SelfDescribingPredicates;
using Stile.Patterns.SelfDescribingPredicates.Evaluators;
#endregion

namespace NJamb.Parser.SpecificationBuilders.SubjectIs.AbstractEnumerable
{
    public abstract class EnumerableIs<TSubject, TItem, TSpecifies, TNegated> : FluentIs<TSubject, TSpecifies, TNegated>,
        IEnumerableIs<TSubject, TItem, TSpecifies>
        where TSubject : class, IEnumerable<TItem>
        where TSpecifies : class, ISpecification
        where TNegated : class, IFluentIs<TSubject, TSpecifies>
    {
        protected EnumerableIs(ICollaboratingSpecificationBuilder<TSubject, TSpecifies> specificationBuilder, Negated negated)
            : base(specificationBuilder, negated) {}

        public TSpecifies Empty
        {
            get
            {
                Evaluator<TSubject, bool> evaluator = ExpectEnumerable<TSubject, TItem>.ToBeEmpty(Negated);
                return SpecificationBuilder.Specify(evaluator);
            }
        }
    }
}
